import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import { axios } from '@/utils/request'

/**
 * 公共API接口
 */
export const api = {
  list: '/quartz/quartzJob/list',
  delete: '/quartz/quartzJob/delete',
  deleteBatch: '/quartz/quartzJob/deleteBatch',
  exportXlsUrl: '/quartz/quartzJob/exportXls',
  importExcelUrl: '/quartz/quartzJob/importExcel'
}

/**
 * 暂停任务
 * @param {*} params
 * @returns
 */
export const quartzJobPause = params => getAction('/quartz/quartzJob/pause', params);

/**
* 重启任务
* @param {*} params
* @returns
*/
export const quartzJobResume = params => getAction('/quartz/quartzJob/resume', params);

/**
* 执行任务
* @param {*} params
* @returns
*/
export const quartzJobExecute = params => getAction('/quartz/quartzJob/execute', params);

/**
* 添加执行任务
* @param {*} params
* @returns
*/
export const addQuartzJob = params => postAction('/quartz/quartzJob/add', params);

/**
* 编辑执行任务
* @param {*} params
* @returns
*/
export const editQuartzJob = params => putAction('/quartz/quartzJob/edit', params);
